using System;
using UnityEngine;

namespace Prototype.FeedTheWorld
{
    public class DestroyOutOfBounds : MonoBehaviour
    {
        private float topBound = 32;
        private float lowBound = -16;

        private void Update()
        {
            if (transform.position.z > topBound)
            {
                Destroy(gameObject);
            }
            else if (transform.position.z < lowBound)
            {
                Debug.Log("Game Over!");
                Destroy(gameObject);
            }
        }
    }
}